<?php
	

defined('_JEXEC') or die('Restricted access'); 
$mainframe = &JFactory::getApplication(); 

$imagesUrl = JURI::root().'media/netbase/images/';
$height_msg = '320px';
$width_msg = '630px';

$config =& JComponentHelper::getParams('com_nbeventmap');
$document   =& JFactory::getDocument();


foreach ($this->lieux as $lieu) { 

    $link =JRoute::_('index.php?option=com_nbeventmap&view=nbeventmap&layout=article&id='.$lieu->slug, false);
    $document->addCustomTag( '<link rel="canonical" href="'.$link.'" />');


    if ($lieu->metadesc) {
        $this->document->setDescription( $lieu->metadesc );
    }
    if ($lieu->metakey) {
        $this->document->setMetadata('keywords', $lieu->metakey);
    }
    if ($mainframe->getCfg('MetaTitle') == '1') {
        $this->document->setTitle(@$lieu->ville.' : '.$lieu->nom.' ('.$lieu->title.')');
    }
?>
    <div id="enregistrement">
    	<?php
        	$this->lieu = $lieu;
			
			$this->_layout='tmpl';
			echo JView::Display('article');
			$this->_layout='default';
		?>
        <div class="nbeventmap_message">
            <table border="2">
                <tr>
                    <td>
                    <?php
                    if ($config->get('nbeventmap_afficher_intro_italique')==1) { ?>
                        <span><em><?php //echo $lieu->intro; ?></em><?php //echo $lieu->message; ?></span><?php ;
                    } else { ?>
                        <span><?php //echo $lieu->intro; echo $lieu->message; ?></span><?php ;
                    }?>
                     <br />
                     <br />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <?php
    
      $jcomments =  JPATH_SITE.'/components/com_jcomments/jcomments.php';
      if ((file_exists($jcomments))and($this->params->get('nbeventmap_jcomments'))) {
        require_once($jcomments);
        echo '<div style="clear: both;">';
        echo JComments::showComments($lieu->id, 'com_nbeventmap', $lieu->nom);
        echo '</div>';
      }
}; ?>

<link rel="stylesheet" href="<?php echo JURI::root();?>media/netbase/css/default/default.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo JURI::root();?>media/netbase/css/nivo-slider.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo JURI::root();?>media/netbase/css/style.css" type="text/css" media="screen" />

<script type="text/javascript" src="<?php echo JURI::root();?>media/netbase/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<?php echo JURI::root();?>media/netbase/js/jquery.nivo.slider.pack.js"></script>

<script type="text/javascript">
	jQuery(document).ready(function() {
		jQuery('#slider').nivoSlider();
	});
</script>
    
<?php if($this->gallery) { ?>
	<h1>Show Gallery</h1>
		<div class="slider-wrapper theme-default" style="padding: 20px;">
            <div id="slider" class="nivoSlider">
	<?php foreach ($this->gallery as $galleries) { ?>
				<img src="<?php echo JURI::root(); ?>media/netbase/api/timthumb.php?src=<?php echo $imagesUrl . $galleries->name;?>&w=<?php echo $width_msg;?>&h=<?php echo $height_msg;?>&q=100" />
	<?php } ?>
			</div>
		</div>	
<?php } ?>

